<template>
    <div class="manageMain">
        <div class="accountInfo">
            <ul>
                <li class="choose">
                    <span v-text="accountInfo[0]"></span>
                    <p>账户余额（元）</p>
                </li>
                <li>
                    <span v-text="accountInfo[1]"></span>
                    <p>账户余额（元）</p>
                </li>
                <li>
                    <span v-text="accountInfo[2]"></span>
                    <p>账户余额（元）</p>
                </li>
            </ul>
        </div>
        <div class="accountTit">
            <ul>
                <li class="first">标的ID</li>
                <li>状态</li>
                <li>募集金额（元）</li>
                <li>待还金额（元）</li>
                <li>已还金额（元）</li>
                <li class="last">时间</li>
            </ul>
        </div>
        <div class="accountList">
            <ul>
                <li v-for="(accountList, index) in accountLists">
                    <router-link :to="`/detail/${accountList.id}`">
                        <span v-text="accountList.id"></span>
                        <span v-text="accountList.statusNmae"></span>
                        <span v-text="accountList.account"></span>
                        <span v-text="accountList.waitPaymentAmount"></span>
                        <span v-text="accountList.paymentAmount"></span>
                        <span v-text="accountList.interestEndTime"></span>
                    </router-link>
                </li>
            </ul>
        </div>
    </div>
</template>
<script>
    import Api from '../api/api'
    const api = new Api();
    export default{
        data(){
            return {
                accountInfo:[],
                accountLists: ''
            }
        },
        created(){
            let param = {
                token: sessionStorage.getItem('token')
            };
            api.getAccountInfo(param).then(res => {
                if(res.data.success){
                    this.accountInfo=[res.data.data.financierAccount.balance,res.data.data.financierAccount.forPaymentMoney,res.data.data.financierAccount.loanamount]
                    this.accountLists= res.data.data.borrowAccountList
                }else{
                    console.log(`账户管理，账户信息接口请求失败！${res.data.cause}`)
                }
            }).catch(err=>{
                console.log(err)
            })
        }
    }
</script>